<?

if (!isset($global))
{
	die(__FILE__." was included directly.  This file should only be included via inc.global.php.  Include() that one instead.");
}

/**********************************************************/
/******************* SITE LOCATIONS ***********************/

// What is the domain name of the site?  
define ("SERVER_DOMAIN","your-domain.org");	// no http://

// What is the path to the site? This is null for many sites.
define ("SERVER_PATH_URL","/your-path-if-any");	// no ending slash

// The following only needs to be set if Pear has been
// installed manually by downloading the files
define ("PEAR_PATH", ""); // no ending slash

// Ok, then lets define some paths (no need to edit these)
define ("HTTP_BASE",SERVER_DOMAIN.SERVER_PATH_URL);
define ("CLASSES_PATH",$_SERVER["DOCUMENT_ROOT"].SERVER_PATH_URL."/classes/");
define ("IMAGES_PATH",SERVER_DOMAIN.SERVER_PATH_URL."/images/");
define ("UPLOADS_PATH",$_SERVER["DOCUMENT_ROOT"].SERVER_PATH_URL."/uploads/");

/**********************************************************/
/***************** DATABASE LOGIN  ************************/

define ("DATABASE_USERNAME","username");
define ("DATABASE_PASSWORD","password");
define ("DATABASE_NAME","database");
define ("DATABASE_SERVER","localhost"); // often "localhost"

/**********************************************************/
/********************* SITE NAMES *************************/

// What is the name of the site?
define ("SITE_LONG_TITLE", "Local Exchange");

// What is the short, friendly, name of the site?
define ("SITE_SHORT_TITLE", "Local Exchange");

/**********************************************************/
/***************** FOR MAINTENANCE ************************/

// If you need to take the website down for maintenance (such
// as during an upgrade), set the following value to true
// and customize the message, if you like

define ("DOWN_FOR_MAINTENANCE", false);
define ("MAINTENANCE_MESSAGE", SITE_LONG_TITLE ." is currently down for maintenance.  Try back in a little while.");

/**************************************************************/
/******************** SITE CUSTOMIZATION **********************/

// email addresses & phone number to be listed in the site
define ("EMAIL_FEATURE_REQUEST","info@your-domain.org");
define ("EMAIL_ADMIN","info@your-domain.org");
define ("PHONE_ADMIN","360-321-1234"); // an email address may be substituted...
define ("EMAIL_FROM", "From:". "reply-to@your-domain.org"); // to override EMAIL_ADMIN 
																				// for replies

// What should appear at the front of all pages?
// Titles will look like "PAGE_TITLE_HEADER - PAGE_TITLE", or something 
// like "Local Exchange - Member Directory";
define ("PAGE_TITLE_HEADER", SITE_LONG_TITLE);

// What keywords should be included in all pages?
define ("SITE_KEYWORDS", "local currency,lets,exchange,". SITE_LONG_TITLE .",php");

// Logo Graphic for Header
define ("HEADER_LOGO", "localx_logo.png");

// Title Graphic for Header
define ("HEADER_TITLE", "localx_title.png");

// Logo for Home Page
define ("HOME_LOGO", "localx_black.png");

// Picture appearing left of logo on Home Page
define ("HOME_PIC", "localx_home.png");

// What content should be in the site header and footer?
define ("PAGE_HEADER_CONTENT", "<table align=center cellpadding=15 cellspacing=0 id=\"mainTable\"><tr><td id=\"header\" align=center><img src=\"http://".HTTP_BASE."/images/". HEADER_LOGO ."\" alt=\"". SITE_SHORT_TITLE . " logo\"></td><td id=\"header\"><h1 align=right><img src=\"http://".HTTP_BASE."/images/". HEADER_TITLE ."\"><br>");
	
define ("PAGE_FOOTER_CONTENT", "<tr><td id=\"footer\" colspan=2><p align=center><strong>". SITE_LONG_TITLE ." </strong>&#8226; <a href=\"http://". SERVER_DOMAIN . SERVER_PATH_URL ."\">". SERVER_DOMAIN ."</a><br><a href=\"mailto:". EMAIL_ADMIN ."\">" . EMAIL_ADMIN ."</a> &#8226; ". PHONE_ADMIN ."<br><font size=\"-2\">Licensed under the <a href=\"http://www.gnu.org/copyleft/gpl.html\">GPL</a> &#8226; Local Exchange <a href=\"http://". SERVER_DOMAIN . SERVER_PATH_URL ."/info/credits.php\">Credits</a></td></tr></table><br>");



/**********************************************************/
/**************** DEFINE SIDEBAR MENU *********************/

$SIDEBAR = array (
	array("Home","index.php"),
	array("Learn More","info/more.php"),
	array("News & Events","news.php"),
	array("Offered","listings.php?type=Offer"),
	array("Wanted","listings.php?type=Want"),
	array("Update Listings","listings_menu.php"),
	array("Exchanges","exchange_menu.php"),
	array("Directory","member_directory.php"),
	array("Member Profile","member_profile.php"),
	array("Contact Us","contact.php"));
	
/**********************************************************/
/**************** DEFINE SITE SECTIONS ********************/

define ("EXCHANGES",0);
define ("LISTINGS",1);
define ("EVENTS",2);
define ("ADMINISTRATION",3);
define ("PROFILE",4);
define ("SECTION_FEEDBACK",5);
define ("SECTION_EMAIL",6);
define ("SECTION_INFO",7);
define ("SECTION_DIRECTORY",8);

$SECTIONS = array (
	array(0, "Exchanges", "exchange.gif"),
	array(1, "Listings", "listing.png"),
	array(2, "Events", "news.png"),
	array(3, "Administration", "admin.png"),
	array(4, "Events", "member.png"),
	array(5, "Feedback", "feedback.png"),
	array(6, "Email", "contact.png"),
	array(7, "Info", "info.png"),
	array(8, "Directory", "directory.png"));

/**********************************************************/
/******************* GENERAL SETTINGS *********************/

define ("USE_RATES",false); // If turned on, listings will include a "Rate" field
define ("UNITS", "Hours");  // This setting affects functionality, not just text displayed, so if you want to use hours/minutes this needs to read "Hours" exactly.  All other unit descriptions are ok, but receive no special treatment (i.e. there is no handling of "minutes").
define ("MAX_FILE_UPLOAD","5000000"); // Maximum file size, in bytes, allowed for uploads to the server
define ("EMAIL_LISTING_UPDATES", false); // Should users receive automatic updates
													 // for new and modified listings?
define ("DEFAULT_UPDATE_INTERVAL", WEEKLY); // If automatic updates are sent, this is
													 // the default interval. Possible
													 // values are NEVER, DAILY, WEEKLY & MONTHLY.
// The following text will appear at the beggining of the email update messages
define ("LISTING_UPDATES_MESSAGE", "<h1>".SITE_LONG_TITLE."</h1>The following listings are new or updated.<p>If you would prefer not to receive automatic email updates, or if you would like to change their frequency, you can do so at the <a href=http://".HTTP_BASE."/member_edit.php?mode=self>Member Profile</a> area of our website.");

// Should inactive accounts have their listings automatically expired?
// This can be a useful feature.  It is an attempt to deal with the 
// age-old local currency problem of new members joining and then not 
// keeping their listings up to date or using the system in any way.  
// It is designed so that if a member doesn't record a trade OR update 
// a listing in a given period of time (default is six months), their 
// listings will be set to expire and they will receive an email to 
// that effect (as will the admin).
define ("EXPIRE_INACTIVE_ACCOUNTS",false); 

// If above is set, after this many days, accounts that have had no
// activity will have their listings set to expire.  They will have 
// to reactiveate them individually if they still want them.
define ("MAX_DAYS_INACTIVE","180");  

// How many days in the future the expiration date will be set for
define ("EXPIRATION_WINDOW","15");	

// How long should expired listings hang around before they are deleted?
define ("DELETE_EXPIRED_AFTER","90"); 

// The following message is the one that will be emailed to the person 
// whose listings have been expired (a delicate matter).
define ("EXPIRED_LISTINGS_MESSAGE", "Hello,\n\nDue to inactivity, your ".SITE_SHORT_TITLE." listings have been set to automatically expire ". EXPIRATION_WINDOW ." days from now.\n\nIn order to keep the ".SITE_LONG_TITLE." system up to date and working smoothly for all members, we have developed an automatic system to expire listings for members who haven't recorded exchanges or updated their listings during a period of ".MAX_DAYS_INACTIVE." days. We want the directory to be up to date, so that members do not encounter listings that are out of date or expired. This works to everyone's advantage.\n\nWe apologize for any inconvenience this may cause you and thank you for your participation. If you have any questions or comments, or are unsure how to best use the system, please reply to this email message or call us at ".PHONE_ADMIN.".\n\nYou have ". EXPIRATION_WINDOW ." days to login to the system and reactivate listings that you would still like to have in the directory.  If you do not reactivate them during that timeframe, your listings will no longer appear in the directory, but will still be stored in the system for another ". DELETE_EXPIRED_AFTER ." days, during which time you can still edit and reactivate them.\n\n\nInstructions to reactivate listings:\n1) Login to the website\n2) Go to Update Listings\n3) Select Edit Offered (or Wanted) Listings\n4) Select the listing to edit\n5) Uncheck the box next to 'Should this listing be set to automatically expire?'\n6) Press the Update button\n7) Repeat steps 1-6 for all listings you wish to reactivate\n");

// The year your local currency started -- the lowest year shown
// in the Join Year menu option for accounts.
define ("JOIN_YEAR_MINIMUM", "2005");  

define ("DEFAULT_COUNTRY", "United States");
define ("DEFAULT_ZIP_CODE", "78741");
define ("DEFAULT_CITY", "Austin");
define ("DEFAULT_STATE", "TX");
define ("DEFAULT_PHONE_AREA", "512");

// Should short date formats display month before day (US convention)?
define ("MONTH_FIRST", true);		

define ("PASSWORD_RESET_SUBJECT", "Your ". SITE_LONG_TITLE ." Account");
define ("PASSWORD_RESET_MESSAGE", "Your password for ". SITE_LONG_TITLE ." has been reset. If you did not request this reset, it is possible your account has been compromised, and you may want to contact the site administrator at ".PHONE_ADMIN.".\n\nYour user id and new password are listed at the end of this message. You can change the automatically generated password by going to the Member Profile section after you login.");
define ("NEW_MEMBER_SUBJECT", "Welcome to ". SITE_LONG_TITLE);
define ("NEW_MEMBER_MESSAGE", "Hello, and welcome to the ". SITE_LONG_TITLE ." community!\n\nA member account has been created for you at:\nhttp://".SERVER_DOMAIN.SERVER_PATH_URL."/member_login.php\n\nPlease login and create your Offered and Wanted Listings.  Your new user id and password are listed at the end of this message. You can change the automatically generated password by going to the Member Profile section after you login.\n\nThank you for joining us.");

/********************************************************************/
/************************* ADVANCED SETTINGS ************************/
// Normally, the defaults for the settings that follow don't need
// to be changed.

// What's the name and location of the stylesheet?
define ("SITE_STYLESHEET", "style.css");

// How long should trades be listed on the "leave feedback for 
// a recent exchange" page?  After this # of days they will be
// dropped from that list.
define ("DAYS_REQUEST_FEEDBACK", "30"); 

// Is debug mode on? (display errors to the general UI?)
define ("DEBUG",true);

// Should adminstrative activity be logged?  Set to 0 for no logging; 1 to 
// log trades recorded by administrators; 2 to also log changes to member 
// settings (LEVEL 2 NOT YET IMPLEMENTED)
define ("LOG_LEVEL", 1);

// How many consecutive failed logins should be allowed before locking out an account?
// This is important to protect against dictionary attacks.  Don't set higher than 10 or 20.
define ("FAILED_LOGIN_LIMIT", 10);

// Are magic quotes on?  Site has not been tested with magic_quotes_runtime on, 
// so if you feel inclined to change this setting, let us know how it goes :-)
define ("MAGIC_QUOTES_ON",false);
set_magic_quotes_runtime (0);

// CSS-related settings.  If you'r looking to change colors, 
// best to edit the CSS rather than add to this...
$CONTENT_TABLE = array("id"=>"contenttable", "cellspacing"=>"0", "cellpadding"=>"3");

// System events are processes which only need to run periodically,
// and so are run at intervals rather than weighing the system
// down by running them each time a particlular page is loaded.
// System Event Codes (such as ACCOUNT_EXPIRATION) are defined in inc.global.php
// System Event Frequency (how many minutes between triggering of events)
$SYSTEM_EVENTS = array (
	ACCOUT_EXPIRATION => 1440);  // Expire accounts once a day (every 1440 minutes)


/**********************************************************/
//	Everything below this line simply sets up the config.
//	Nothing should need to be changed, here.

if (PEAR_PATH != "")
	ini_set("include_path", PEAR_PATH .'/' . PATH_SEPARATOR . ini_get("include_path"));

if (DEFAULT_COUNTRY == "United States") {
	define ("ZIP_TEXT", "Zip Code");
	define ("STATE_TEXT", "State");
} else {
	define ("ZIP_TEXT", "Postal Code");
	define ("STATE_TEXT", "Region");
}

if (DEBUG) error_reporting(E_ALL);
	else error_reporting(E_ALL ^ E_NOTICE);

define("LOAD_FROM_SESSION",-1);  // Not currently in use

// URL to PHP page which handles redirects and such.
define ("REDIRECT_URL",SERVER_PATH_URL."/redirect.php");

?>
